package com.ygqh.baby.po;

import com.ygqh.baby.constant.Constant;

import java.math.BigDecimal;
import java.util.Date;

public class YgUserBalance {
	private Long id;

	private Long userId;

	private BigDecimal preincomePrice;

	private BigDecimal balancePrice;

	private BigDecimal freezePrice;

	private BigDecimal withdrawPrice;

	private Date createTime;

	private Date updateTime;

    private BigDecimal accountPrice;

    private String platformNo;

    // ============

	private YgUser ygUser;

	private BigDecimal cultivationPrice;

	public YgUserBalance() {
	}

	public YgUserBalance(Long userId, String platformNo) {
		this.userId = userId;
		this.platformNo = platformNo;
		this.preincomePrice = BigDecimal.ZERO;
		this.balancePrice = BigDecimal.ZERO;
		this.freezePrice = BigDecimal.ZERO;
		this.withdrawPrice = BigDecimal.ZERO;
		this.accountPrice = BigDecimal.ZERO;
		this.createTime = new Date();
	}

	public BigDecimal getAccountPrice() {
        return accountPrice;
    }

    public void setAccountPrice(BigDecimal accountPrice) {
        this.accountPrice = accountPrice;
    }

    public YgUser getYgUser() {
		return ygUser;
	}

	public void setYgUser(YgUser ygUser) {
		this.ygUser = ygUser;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public BigDecimal getPreincomePrice() {
		return preincomePrice;
	}

	public void setPreincomePrice(BigDecimal preincomePrice) {
		this.preincomePrice = preincomePrice;
	}

	public BigDecimal getBalancePrice() {
		return balancePrice;
	}

	public void setBalancePrice(BigDecimal balancePrice) {
		this.balancePrice = balancePrice;
	}

	public BigDecimal getFreezePrice() {
		return freezePrice;
	}

	public void setFreezePrice(BigDecimal freezePrice) {
		this.freezePrice = freezePrice;
	}

	public BigDecimal getWithdrawPrice() {
		return withdrawPrice;
	}

	public void setWithdrawPrice(BigDecimal withdrawPrice) {
		this.withdrawPrice = withdrawPrice;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	public BigDecimal getCultivationPrice() {
		return cultivationPrice;
	}

	public void setCultivationPrice(BigDecimal cultivationPrice) {
		this.cultivationPrice = cultivationPrice;
	}

    public String getPlatformNo() {
        return platformNo;
    }

    public void setPlatformNo(String platformNo) {
        this.platformNo = platformNo;
    }

    @Override
	public String toString() {
		return "YgUserBalance [id=" + id + ", userId=" + userId + ", preincomePrice=" + preincomePrice + ", balancePrice=" + balancePrice + ", freezePrice="
				+ freezePrice + ", withdrawPrice=" + withdrawPrice + ", createTime=" + createTime + ", updateTime=" + updateTime + ", ygUser=" + ygUser + ", cultivationPrice=" + cultivationPrice + "]";
	}

	public String getPlatformName() {
		if (Constant.YIIGOO_PLATFORM_NO.equals(platformNo)) {
			return "壹果商城";
		} else if (Constant.YIJIADIAN_PLATFORM_NO.equals(platformNo)) {
			return "壹家店";
		}
		return "";
	}
}